package com.example.administrator.pomelostreet.HttpUtils;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/2/10.
 */

public class NewClothFragmentJson1 {

    public static List<NewClothFragmentJson1Been> getresult(String path) {
        String json=new String(path);
        try {
            JSONObject jsonObject=new JSONObject(json);
            JSONObject data = jsonObject.getJSONObject("data");
            List<NewClothFragmentJson1Been> arr=new ArrayList<>();
            JSONArray category_data = data.getJSONArray("category_data");
            for (int i=0;i<category_data.length();i++){
                NewClothFragmentJson1Been been1=new NewClothFragmentJson1Been();
                JSONObject jsonObject1 = category_data.getJSONObject(i);
                been1.setPicture_url(jsonObject1.getString("picture_url"));
                been1.setName(jsonObject1.getString("name"));
                arr.add(been1);
            }
            return arr;
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return null;
    }


}
